#ifndef LIBRARY2_H
#define LIBRARY2_H

#include <map>
#include <vector>
#include <string>
#include <iostream>

class Library{

    std::map<int, std::string> m_paths;

    public:
        Library () {}

        void init()
        {
            m_paths[0] = std::string("data/gfx/hole/mapHole.png");
            m_paths[1000] = std::string("data/gfx/hole/mapHoleNeon.png");
            // m_paths[1000] = std::string("data/gfx/hole/mapHoleIce.png");

            m_paths[1] = std::string("data/gfx/standard/mapStandard.png");
            m_paths[2] = std::string("data/gfx/standard/mapStandardNeon.png");
            m_paths[3] = std::string("data/gfx/standard/mapStandardIce.png");
            // m_paths[2] = std::string("data/gfx/standard/mapStandardAlt.png");

            m_paths[100] = std::string("data/gfx/wall/mapWall.png");
            m_paths[101] = std::string("data/gfx/wall/mapWallNeon.png");

            //m_paths[200] = std::string("data/gfx/mapTopWall.png");
        }

        std::vector<std::string> getLibraryPaths()const
        {
            std::vector<std::string> paths;
            for ( std::map<int, std::string>::const_iterator itPath = m_paths.begin() ; itPath != m_paths.end() ; ++itPath )
            {
                paths.push_back(itPath->second);
            }

            return paths;
        }

        std::vector<int> getIDs()const
        {
            std::vector<int> ids;

            for ( std::map<int, std::string>::const_iterator itPath = m_paths.begin() ; itPath != m_paths.end() ; ++itPath )
            {
                std::cout << "Push: " << itPath->first << std::endl;
                ids.push_back(itPath->first);
            }

            return ids;
        }

        const std::string& getPath(int id)const
        {
            std::map<int, std::string>::const_iterator itElem = m_paths.find(id);
            if ( itElem == m_paths.end() )
            {
                std::cerr << "Library -> ID '" << id << "' not found" << std::endl;

                static const std::string emptyString = "";
                return emptyString;
            }

            return itElem->second;
        }
};

#endif
